version := $(shell /bin/date "+%Y-%m-%d %H:%M")

build:
	go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" gomaster.go
	$(if $(shell command -v upx), upx gomaster)
mac:
	GOOS=darwin go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o gomaster-darwin gomaster.go
	$(if $(shell command -v upx), upx gomaster-darwin)
win:
	GOOS=windows go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o gomaster.exe gomaster.go
	$(if $(shell command -v upx), upx gomaster.exe)
linux:
	GOOS=linux go build -ldflags="-s -w" -ldflags="-X 'main.BuildTime=$(version)'" -o gomaster-linux gomaster.go
	$(if $(shell command -v upx), upx gomaster-linux)
